from artifacts.base.artifacts_impl import *
from artifacts.base.attr_type import AttrType


need_main_attr = {
    Flower: AttrType.HP,
    Plume: AttrType.ATK,
    Clock: AttrType.HP_P,
    Cup: AttrType.HP_P,
    Head: AttrType.HP_P
}


def evaluate(artifacts):
    score = 0
    if artifacts.main_attr is not need_main_attr[type(artifacts)]:
        return score
    if not isinstance(artifacts, Flower) and not isinstance(artifacts, Plume):
        return 3
    for item in artifacts.bonus_attr_list:
        if item.type == AttrType.HP_P:
            score += 1
    return score
